package com.xiaozhen.sso.feign;

import com.xiaozhen.common.core.constant.ServiceNameConstants;
import com.xiaozhen.common.core.domain.R;
import com.xiaozhen.common.core.domain.system.SysUser;
import com.xiaozhen.security.config.FeignInterceptor;
import com.xiaozhen.sso.feign.fallback.SysUserServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * HISTORY
 *
 * @author zhenweisheng
 * @date 2021/8/5 16:56
 * @description:
 */
@FeignClient(name = ServiceNameConstants.SYSTEM_SERVICE,
        configuration = FeignInterceptor.class,
        fallbackFactory = SysUserServiceFallback.class)
public interface SysUserService {

    /**
     * 根据用户名查询用户信息
     *
     * @param username
     * @return
     */
    @PostMapping("/sysUser/selectByUsername")
    R<SysUser> selectByUsername(@RequestParam("username") String username);
}
